Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[udev] Add customize udev rule for console switch(for e1031) #5571

Merged
merged 7 commits into from
Oct 15, 2020

Conversation

sandycelestica
Copy link
Contributor

@sandycelestica sandycelestica commented Oct 9, 2020

- Why I did it
This is for customers customize their own device name for ttyUSB devices

- How I did it
Design an udev rule for an assigned console switch; And rename all the ports as assigned prefix.
Here is an console switch called C0 and rename 40 console ports as C0-1 to C0-40.

- How to verify it
plugin the C0 use command:
ls /dev/C0* this can check whether we rename success;

- Which release branch to backport (provide reason below if selected)
201911

- Description for the changelog
This design including following files to change:

*.rules this is for the design of udev rules
popmsg.sh this is for pop msg when the device been plugged out. It shows reminder that the device plug out
udev_prefix.sh this file is for record the name prefix that customers want to use
platform-modules-haliburton.install this is config file to copy files *.rules to the /etc/rules.d so that this rule can be loaded when system reboot

@sandycelestica
Copy link
Contributor Author

sandycelestica commented Oct 9, 2020

- Why I did it
This is for customers customize their own device name for ttyUSB devices

- How I did it
Design an udev rule for an assigned console switch; And rename all the ports as assigned prefix.
Here is an console switch called C0 and rename 40 console ports as C0-1 to C0-40.
- How to verify it
plugin the C0 use command:
ls /dev/C0* this can check whether we rename success;

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog
This design including following files to change:

  1. *.rules this is for the design of udev rules
  2. popmsg.sh this is for pop msg when the device been plugged out. It shows reminder that the device plug out
  3. udev_prefix.sh this file is for record the name prefix that customers want to use
  4. platform-modules-haliburton.install this is config file to copy files *.rules to the /etc/rules.d so that this rule can be loaded when system reboot

Copy link
Contributor

@Blueve Blueve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Sandy! The rule looks good to me.
Could you please remove all personal debugging code from your source? We can create a document to help others create/debug new rules.

In other hand, one question: will this rule be loaded automatically after SONiC install/reboot or console device plug-in/out (hot plug)?

Remove some debug codes
remove the debug info
remove debug info
@yxieca
Copy link
Contributor

yxieca commented Oct 9, 2020

Please fill in the PR template above.

@sandycelestica
Copy link
Contributor Author

- Why I did it

- How I did it

- How to verify it

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

- Why I did it
This is for customers customize their own device name for ttyUSB devices

- How I did it
Design an udev rule for an assigned console switch; And rename all the ports as assigned prefix.
Here is an console switch called C0 and rename 40 console ports as C0-1 to C0-40.
- How to verify it
plugin the C0 use command:
ls /dev/C0* this can check whether we rename success;

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog
This design including following files to change:

  1. *.rules this is for the design of udev rules
  2. popmsg.sh this is for pop msg when the device been plugged out. It shows reminder that the device plug out
  3. udev_prefix.sh this file is for record the name prefix that customers want to use
  4. platform-modules-haliburton.install this is config file to copy files *.rules to the /etc/rules.d so that this rule can be loaded when system reboot

@sandycelestica sandycelestica changed the title This changes for udev rules design and customize the device name. And the consutil should be change for support this design [udev] Add customize udev rule for console switch(for e1031) Oct 14, 2020
@Blueve
Copy link
Contributor

Blueve commented Oct 14, 2020

retest this please

@Blueve Blueve merged commit 4c8b1c4 into sonic-net:master Oct 15, 2020
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
…et#5571)

* Add files via upload
* Update platform-modules-haliburton.install
* Update 50-ttyUSB-C0.rules
* Update popmsg.sh
* Update udev_prefix.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants